/*
 * Arm SCP/MCP Software
 * Copyright (c) 2020-2024, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Description:
 *     Definitions for SCMI and TRANSPORT module configurations.
 */

#ifndef SCP_PLATFORM_SCMI_H
#define SCP_PLATFORM_SCMI_H

/* SCMI agent identifiers */
enum scp_platform_scmi_agent_id {
    /* 0 is reserved for the platform */
    SCP_SCMI_AGENT_ID_PSCI = 1,
};

/* SCMI service indexes */
enum scp_platform_scmi_service_idx {
    SCP_PLATFORM_SCMI_SERVICE_IDX_PSCI,
    SCP_PLATFORM_SCMI_SERVICE_IDX_COUNT,
};

/* SCP<->AP Fast channels indexes */
enum rdn2_plat_fch_idx {
    RDN2_PLAT_FCH_CPU0_LEVEL_SET,
    RDN2_PLAT_FCH_CPU0_LIMIT_SET,
    RDN2_PLAT_FCH_CPU0_LEVEL_GET,
    RDN2_PLAT_FCH_CPU0_LIMIT_GET,

    RDN2_PLAT_FCH_CPU1_LEVEL_SET,
    RDN2_PLAT_FCH_CPU1_LIMIT_SET,
    RDN2_PLAT_FCH_CPU1_LEVEL_GET,
    RDN2_PLAT_FCH_CPU1_LIMIT_GET,

    RDN2_PLAT_FCH_CPU2_LEVEL_SET,
    RDN2_PLAT_FCH_CPU2_LIMIT_SET,
    RDN2_PLAT_FCH_CPU2_LEVEL_GET,
    RDN2_PLAT_FCH_CPU2_LIMIT_GET,

    RDN2_PLAT_FCH_CPU3_LEVEL_SET,
    RDN2_PLAT_FCH_CPU3_LIMIT_SET,
    RDN2_PLAT_FCH_CPU3_LEVEL_GET,
    RDN2_PLAT_FCH_CPU3_LIMIT_GET,

#if (NUMBER_OF_CLUSTERS > 4)
    RDN2_PLAT_FCH_CPU4_LEVEL_SET,
    RDN2_PLAT_FCH_CPU4_LIMIT_SET,
    RDN2_PLAT_FCH_CPU4_LEVEL_GET,
    RDN2_PLAT_FCH_CPU4_LIMIT_GET,

    RDN2_PLAT_FCH_CPU5_LEVEL_SET,
    RDN2_PLAT_FCH_CPU5_LIMIT_SET,
    RDN2_PLAT_FCH_CPU5_LEVEL_GET,
    RDN2_PLAT_FCH_CPU5_LIMIT_GET,

    RDN2_PLAT_FCH_CPU6_LEVEL_SET,
    RDN2_PLAT_FCH_CPU6_LIMIT_SET,
    RDN2_PLAT_FCH_CPU6_LEVEL_GET,
    RDN2_PLAT_FCH_CPU6_LIMIT_GET,

    RDN2_PLAT_FCH_CPU7_LEVEL_SET,
    RDN2_PLAT_FCH_CPU7_LIMIT_SET,
    RDN2_PLAT_FCH_CPU7_LEVEL_GET,
    RDN2_PLAT_FCH_CPU7_LIMIT_GET,

#    if (NUMBER_OF_CLUSTERS > 8)
    RDN2_PLAT_FCH_CPU8_LEVEL_SET,
    RDN2_PLAT_FCH_CPU8_LIMIT_SET,
    RDN2_PLAT_FCH_CPU8_LEVEL_GET,
    RDN2_PLAT_FCH_CPU8_LIMIT_GET,

    RDN2_PLAT_FCH_CPU9_LEVEL_SET,
    RDN2_PLAT_FCH_CPU9_LIMIT_SET,
    RDN2_PLAT_FCH_CPU9_LEVEL_GET,
    RDN2_PLAT_FCH_CPU9_LIMIT_GET,

    RDN2_PLAT_FCH_CPU10_LEVEL_SET,
    RDN2_PLAT_FCH_CPU10_LIMIT_SET,
    RDN2_PLAT_FCH_CPU10_LEVEL_GET,
    RDN2_PLAT_FCH_CPU10_LIMIT_GET,

    RDN2_PLAT_FCH_CPU11_LEVEL_SET,
    RDN2_PLAT_FCH_CPU11_LIMIT_SET,
    RDN2_PLAT_FCH_CPU11_LEVEL_GET,
    RDN2_PLAT_FCH_CPU11_LIMIT_GET,

    RDN2_PLAT_FCH_CPU12_LEVEL_SET,
    RDN2_PLAT_FCH_CPU12_LIMIT_SET,
    RDN2_PLAT_FCH_CPU12_LEVEL_GET,
    RDN2_PLAT_FCH_CPU12_LIMIT_GET,

    RDN2_PLAT_FCH_CPU13_LEVEL_SET,
    RDN2_PLAT_FCH_CPU13_LIMIT_SET,
    RDN2_PLAT_FCH_CPU13_LEVEL_GET,
    RDN2_PLAT_FCH_CPU13_LIMIT_GET,

    RDN2_PLAT_FCH_CPU14_LEVEL_SET,
    RDN2_PLAT_FCH_CPU14_LIMIT_SET,
    RDN2_PLAT_FCH_CPU14_LEVEL_GET,
    RDN2_PLAT_FCH_CPU14_LIMIT_GET,

    RDN2_PLAT_FCH_CPU15_LEVEL_SET,
    RDN2_PLAT_FCH_CPU15_LIMIT_SET,
    RDN2_PLAT_FCH_CPU15_LEVEL_GET,
    RDN2_PLAT_FCH_CPU15_LIMIT_GET,

#    endif /* #if (NUMBER_OF_CLUSTERS > 4) */
#endif /* #if (NUMBER_OF_CLUSTERS > 8) */

    RDN2_PLAT_FCH_COUNT,
};

/* SCP <-> AP Transport channels */
enum rdn2_transport_channel_idx {
    RDN2_TRANSPORT_SCMI_SERVICE_PSCI,

#if defined(BUILD_HAS_SCMI_PERF_FAST_CHANNELS)
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU0_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU0_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU0_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU0_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU1_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU1_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU1_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU1_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU2_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU2_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU2_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU2_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU3_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU3_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU3_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU3_LIMIT_GET,

#    if (NUMBER_OF_CLUSTERS > 4)
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU4_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU4_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU4_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU4_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU5_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU5_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU5_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU5_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU6_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU6_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU6_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU6_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU7_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU7_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU7_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU7_LIMIT_GET,

#        if (NUMBER_OF_CLUSTERS > 8)
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU8_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU8_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU8_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU8_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU9_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU9_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU9_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU9_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU10_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU10_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU10_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU10_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU11_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU11_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU11_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU11_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU12_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU12_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU12_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU12_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU13_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU13_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU13_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU13_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU14_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU14_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU14_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU14_LIMIT_GET,

    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU15_LEVEL_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU15_LIMIT_SET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU15_LEVEL_GET,
    RDN2_TRANSPORT_SCMI_PERF_FCH_CPU15_LIMIT_GET,

#        endif /* #if (NUMBER_OF_CLUSTERS > 4) */
#    endif /* #if (NUMBER_OF_CLUSTERS > 8) */

#endif /* BUILD_HAS_SCMI_PERF_FAST_CHANNELS */
    RDN2_TRANSPORT_CHANNELS_COUNT,
};

#endif /* SCP_PLATFORM_SCMI_H */
